package com.mercator.client.graph;

import java.util.LinkedList;

import org.vaadin.gwtgraphics.client.DrawingArea;
import org.vaadin.gwtgraphics.client.Shape;

public abstract class DGraph<T extends Comparable<? super T>, N extends GNode<T,N, ? extends Shape> & Drawable,  G extends Graph<T, N>> extends DContainer<T,N,G> implements Drawable , Iterable<N>{

	protected DrawingArea canvas;
	private LinkedList<N> selected;
	public DGraph(DrawingArea canvas) {
		 super(canvas);
		 this.canvas = canvas;
		 this.selected = new LinkedList<N>();
		 
	}
	
	
	public void unselectAll(){
		for(N n: selected)
			n.unselect();
	}
	
	public void updateSelected(){
		for(N n: this)
			if(n.isSelected())
				selected.add(n);
	}

}
